<?php

namespace App\Models;

use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Model;

class AdminManager extends Model
{
	use HasDateTimeFormatter;
    use SoftDeletes;

    protected $table = 'admin_manager';

    protected $fillable = [
        'admin_id',
        'group_id',
        'user_id',
        'title',
        'description',
        'manager_type',
        'start_time',
        'end_time',
        'address',
        'longitude',
        'latitude',
        'target_amount',
        'personal_donation_amount',
        'corporate_donation_amount',
        'random_donation_amount',
        'cover_path',
        'excess_donation',
        'content',
        'beneficiaries',
        'beneficiary_name',
        'online_status',
        'certificate_template_id',
        'payment_channel',
        'personalized_donation',
        'donation_type',
        'donate_together',
        'registration_number'
    ];

    public function users()
    {
        return $this->belongsTo(User::class, 'user_id');
    }

    public function admin_group()
    {
        return $this->belongsTo(AdminUserGroup::class, 'group_id');
    }

    public function manager_type()
    {
        return $this->belongsTo(AdminManagerType::class, 'manager_type');
    }
}
